//
//  BrowseTableViewCell.m
//  Newproject3
//
//  Created by rimi on 16/9/21.
//  Copyright © 2016年 Liang. All rights reserved.
//

#import "BrowseTableViewCell.h"

@implementation BrowseTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self.contentView addSubview:self.leftImage];
        [self.contentView addSubview:self.titleLabel];
        [self.contentView addSubview:self.detailLabel];
    }
    return self;
}

-(void)layoutSubviews{
    [super layoutSubviews];
    self.leftImage.frame = CGRectMake(_width*0.01, _height*0.05, _width*0.3, _height*0.9);
    self.titleLabel.frame = CGRectMake(_width*0.32, _height*0.08, _width*0.4, _height*0.2);
    self.detailLabel.frame = CGRectMake(_width*0.32, _height*0.32, _width*0.68, _height*0.62);
}

-(UIImageView *)leftImage{
    if (_leftImage == nil) {
        _leftImage = [[UIImageView alloc]init];
    }
    return _leftImage;
}

-(UILabel *)titleLabel{
    if (_titleLabel == nil) {
        _titleLabel = [[UILabel alloc]init];
        _titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
        _titleLabel.numberOfLines = 0;
        _titleLabel.font = [UIFont systemFontOfSize:19];
    }
    return _titleLabel;
}

-(UILabel *)detailLabel{
    if (!_detailLabel) {
        _detailLabel = [[UILabel alloc]init];
        _detailLabel.lineBreakMode = NSLineBreakByWordWrapping;
        _detailLabel.numberOfLines = 0;
        _detailLabel.font = [UIFont systemFontOfSize:13];
    }
    return _detailLabel;
}

@end
